package com.tang.managementdemo.controller;

import com.tang.managementdemo.pojo.JopOption;
import com.tang.managementdemo.pojo.Result;
import com.tang.managementdemo.pojo.StuOption;
import com.tang.managementdemo.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    @GetMapping("/empJobData")
    public Result empJobData() {
       JopOption jopOption = reportService.findEmpJobData();
        return Result.success(jopOption);
    }

    @GetMapping("/empGenderData")
    public Result empGenderData() {
        List<Map> genOption = reportService.findEmpGenderData();
       return Result.success(genOption);
    }

    @GetMapping("/studentDegreeData")
    public Result studentDegreeData() {
        List<Map> genOption = reportService.findStudentDegreeData();
        return Result.success(genOption);
    }

    @GetMapping("/studentCountData")
    public Result studentCountData() {
        StuOption stuOption = reportService.findStudentCountData();
        return Result.success(stuOption);
    }
}
